package com.ruoyi.web.controller.pdf;

import com.alibaba.fastjson.JSONObject;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

public class DemoDAO<T> {

    static int DEPT_ID =  1 ;
    String driverName = "com.mysql.jdbc.Driver" ;
    String url = "jdbc:mysql://10.1.37.8:3306/star_screen?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai" ;
    String userName = "star_screen" ;
    String password = "KXkRbMBfJNRmsKs7" ;
    String sql =  "insert into ta_sv_contract_info(dept_id, dept_name, contract_id, contract_name, contract_sign_date, contract_end_date, contract_type1, " +
            "contract_type2, contract_account, done_account, contract_state, abnomal_type) values (?,?,?,?,?,?,?,?,?,?,?,?)" ;

    public void save(List<T> list) {

            //Class.forName(driverName);
            //Connection connection = DriverManager.getConnection(url, userName, password);
            //PreparedStatement preparedStatement = connection.prepareStatement(sql);
        for (T t : list) {
            System.out.println(JSONObject.toJSONString(t));
        }

    }
}
